//
//  YBHomeViewModel.swift
//  Moonlight
//
//  Created by Penlon Kim on 2024/1/6.
//  Copyright © 2024 Moonlight Game Streaming Project. All rights reserved.
//

import UIKit

class YBHomeViewModel: BaseViewModel {
    lazy var gameClientInfoModel = YBGameClientInfoModel()
}

// MARK: - 网络请求
extension YBHomeViewModel {
    
    /// 根据渠道号获取购买地址
    func req_AppBanner(_ number: String, handler: @escaping BKResultHandler) {
        self.getReq(path: NetApiPort.Buy.appBanner + "/" + number, handler: handler)
    }
    
    /// 获取套餐信息-游戏手机端
    func req_GameClientInfo(handler: @escaping BKResultHandler) {
        self.getReq(path: NetApiPort.User.gameClientInfo, handler: handler)
    }
    
    /// 获取排队人数
    func req_GetQueueNum(_ type: String, handler: @escaping BKResultHandler) {
        self.getReq(path: NetApiPort.Queue.getQueueNum + "/" + type, handler: handler)
    }
    
    /// 扣减排队人数
    func req_CutQueueNum(_ type: String, handler: @escaping BKResultHandler) {
        self.getReq(path: NetApiPort.Queue.cutQueueNum + "/" + type, handler: handler)
    }

    /// 故障报修
    func req_Gzbx(_ params: [String : Any], handler: @escaping BKResultHandler) {
        self.postReq(path: NetApiPort.VirtualMachine.save, params: params, handler: handler)
    }
    
    /// popSwitch
    func req_popSwitch(handler: @escaping BKResultHandler) {
        self.getReq(path: NetApiPort.User.popswitch, handler: handler)
    }
    
    /// 兑换二维码
    func req_qrcode(handler: @escaping BKResultHandler) {
        self.postReq(path: NetApiPort.Qrcode.code, handler: handler)
    }
}
